package com.example.huawei;

import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * 题目描述
 * •连续输入字符串，请按长度为8拆分每个字符串后输出到新的字符串数组；
 * •长度不是8整数倍的字符串请在后面补数字0，空字符串不处理。
 *
 * @author mdl
 * @date 2020/4/21 20:23
 */
public class Test {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<String> list = new ArrayList<>();

        list.add(sc.nextLine());
        list.add(sc.nextLine());

        int max = 8;

        for (String str : list) {
            DecimalFormat df = new DecimalFormat("00000000");
            if (str.length() <= max) {
                System.out.println(str + String.format("%1$0" + (max - str.length()) + "d", 0));
            } else {
                StringBuilder sb = new StringBuilder(str);

                int len = sb.length() / max;
                int mod = sb.length() % max;
                for (int i = 0; i < len; i++) {
                    System.out.println(sb.substring(i * max, i * max + max).toString());
                }
                if (mod != 0) {
                    String temp = sb.substring(str.length() - mod, str.length()).toString();
                    System.out.println(temp + String.format("%1$0" + (max - temp.length()) + "d", 0));
                }

            }
        }
        sc.close();

    }
}
